<?php
require 'header.php';
session_start();
include("connect.php");
if($_SESSION['username']=="")
{
	echo "<script>alert('登录后操作');window.history.back();</script>";
}
?>
<div class="container">
	<div class="card">
		<img src="./img/0.png" class="card-img-top">
		<h2 style="display: inline-block; margin-top: 20px;">上传的书籍</h2>
		<?php
				$user=$_SESSION['username'];
	   			$sql="select * from  bookinfo where username='$user' order by id DESC";
	   			$result=mysqli_query($conn,$sql);
	   			while($data=mysqli_fetch_array($result))
	   {
	   ?>
		<div class="card-body bg-primary">
			<div class="card" >
				<h5 class="card-header">
					<?php echo $data['bookname']?>
				</h5>
				<div class="card-body">
					<h6 class="card-title">
						分类：<?php echo $data['classify']?>
					</h6>
					<p class="card-text">
						<?php echo $data['article']?>
					</p>
					<a href="delete.php?id=<?php echo $data['id']?>&biao=bookinfo" class="btn btn-danger">删除</a>
				</div>
			</div>
		</div>
		<?php
	   }
	   	?>
	</div>
</div>
</body>